import { createStore, combineReducers, applyMiddleware } from "redux"
// 做异步的中间件
import thunk from "redux-thunk"
// 浏览器使用插件工具
import { composeWithDevTools } from "redux-devtools-extension"

// 引入模块仓库
import login from "./modules/login"
import register from "./modules/register"
import index from "./modules/index"
import home from "./modules/home"
import cate from "./modules/cate"
import detail from "./modules/detail"
import shop from "./modules/shop"
import me from "./modules/me"
// 合并reducer
let reducer = combineReducers({
    login,
    register,
    index,
    home,
    cate,
    detail,
    shop,
    me,
})

// 创建仓库
let store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk)))

// 导出仓库
export default store;